#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>

typedef websocketpp::server<websocketpp::config::asio> server;

void on_message(server* s, websocketpp::connection_hdl hdl, server::message_ptr msg) {
    s->send(hdl, msg->get_payload(), msg->get_opcode());
}

int main() {
    server print_server;

    print_server.set_message_handler(bind(&on_message,&print_server,::_1,::_2));

    print_server.listen(9002);
    print_server.start_accept();

    print_server.run();
}